/*
 * set.hpp
 *
 *  Created on: 19-05-2013
 *      Author: Kopik
 */

#ifndef SET_HPP_
#define SET_HPP_

#include <QList>
#include <QObject>
#include <QSharedPointer>

#include "question.hpp"

class Set: public QObject
{
	Q_OBJECT

	Q_PROPERTY(int id READ id)
	Q_PROPERTY(QString name READ name WRITE setName)
	Q_PROPERTY(QString desc READ desc WRITE setDesc)
	Q_PROPERTY(QList<QSharedPointer<Question>> questions READ questions WRITE setQuestions)
public:
	Set(const int &id, const QString &name, const QString &desc, QList<QSharedPointer<Question> > &questions, QObject *parent = 0);

	int id() const;
	QString name() const;
	QString desc() const;
	QList<QSharedPointer<Question> > questions() const;

	void setName(const QString &newName);
	void setDesc(const QString &newDesc);
	void setQuestions(const QList<QSharedPointer<Question> > &questions);

	void addQuestion(QSharedPointer<Question> question);

private:
	int m_id;
	QString m_name;
	QString m_desc;
	QList<QSharedPointer<Question> > m_questions;
};



#endif /* SET_HPP_ */
